<?php
namespace app\index\controller;
use app\index\controller\Base;
use think\Db;

class Search extends Base{
	public function index(){
		$keywords=input('keywords');
		// $map['title']=['like','%'.$keywords.'%'];
		// $search=db('article')->where($map)
		// paginate(3);
		// session(null);
		$search=db('article')->where('title','like','%'.$keywords.'%')->paginate(3,false,$config=['query'=>array('keywords'=>$keywords)]);
		$this->assign('search',$search);
		$this->assign('keywords',$keywords);
		return $this->fetch();
	}
}

?>